const express = require('express');
// 引入body-parser中间件，用来处理post请求体body中的数据
const bodyParser = require('body-parser')
// 引入multer中间件，用于处理上传的文件数据
const multer = require('multer')
let uploadRouter=require('./uploadRouter');



let serve = express();
const app = serve.listen(8080, function(){
    console.log('express + multer 实现文件上传')
  })
  

serve.use(express.static('./src'));
serve.use(express.static('./public'));
serve.use(express.json()) //把数据转化成json格式
serve.use(express.urlencoded({ extended: false }));

serve.use(uploadRouter);

//服务器监听
serve.listen(8082)